package com.badibadi.fragment;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.json.JSONException;

import net.tsz.afinal.FinalBitmap;
import net.tsz.afinal.exception.AfinalException;
import cn.sharesdk.onekeyshare.OnekeyShare;

import com.badibadi.activity.ActivityReadingActivity;
import com.badibadi.activity.AfterLandingActivity;
import com.badibadi.activity.CalendarMyActivityActivity;
import com.badibadi.activity.ClubFriendsActivity;
import com.badibadi.activity.ClubHomepageActivity;
import com.badibadi.activity.ClubListActivity;
import com.badibadi.activity.ClubMyClubActivity;
import com.badibadi.activity.InformActivity;
import com.badibadi.activity.LogReadingActivity;
import com.badibadi.activity.LookAtTheDetailedActivity;
import com.badibadi.activity.MyDataActivity;
import com.badibadi.activity.MyOtherSpaceActivity;
import com.badibadi.activity.MyPoly1Activity;
import com.badibadi.activity.PicturePreviewActivity;
import com.badibadi.activity.PinyinSeeOtherPeopleFriendActivity;
import com.badibadi.activity.RecordMyRecordListActivity;
import com.badibadi.activity.SeeOtherPeoplePolyActivity;
import com.badibadi.activity.SeeOtherPeopleSpaceActivity;
import com.badibadi.activity.UpPicturesActivity;
import com.badibadi.adapter.GridViewSHUZHUAdapter;
import com.badibadi.infos.BiaoQing;
import com.badibadi.infos.BrowseAllPhoto_Model;
import com.badibadi.infos.ClubListModel;
import com.badibadi.infos.PersonalCenterHomePageModel;
import com.badibadi.infos.RecordModel;
import com.badibadi.infos.Results;
import com.badibadi.infos.User_trends_Model;
import com.badibadi.mytools.CalendarTools;
import com.badibadi.mytools.CommonUtils;
import com.badibadi.mytools.Constants;
import com.badibadi.mytools.Dialog;
import com.badibadi.mytools.DisplayUtil;
import com.badibadi.mytools.HtmlUtils;
import com.badibadi.mytools.IOUtils;
import com.badibadi.mytools.ImageTools;
import com.badibadi.mytools.JSONUtils;
import com.badibadi.mytools.MyThreadTool;
import com.badibadi.mytools.PopWindowUtils;
import com.badibadi.mytools.ShareSDKTools;
import com.badibadi.mytools.SinaExpressionTools;
import com.badibadi.mytools.SystemUtils;
import com.badibadi.mytools.Utils;
import com.badibadi.mytools.ViewHolder;
import com.badibadi.mytools.ViewTools;
import com.badibadi.uniclubber.R;
import com.libjph.util.JsonUtil;
import com.libjph.util.StringUtil;
//import com.lidroid.xutils.util.LogUtils;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.display.RoundedBitmapDisplayer;
import com.nostra13.universalimageloader.utils.IoUtils;
import com.view.my_view.XListView;
import com.view.my_view.XListView.IXListViewListener;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.support.v4.app.Fragment;
import android.text.TextUtils.TruncateAt;
import android.util.Log;
import android.view.FocusFinder;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TabHost;
import android.widget.TextView;
import android.widget.Toast;

/**
 * （主页） 这是主页 MyHomePage 心情、活动、俱乐部站内分享操作 layoutId addData delete
 * 
 * @author Administrator getView initTopViewId showTopView initRecordId
 *         RecordDongtai initClubId CreateClubDongtai initUpPictureId
 *         UpPictureDongtai initDongTaiId XinQingDongtai initActivityId
 *         PostActivityDongtai holder.head.setOnClickListener(new
 *         View.OnClickListener() {
 * @Override public void onClick(View v) { // TODO Auto-generated method stub
 *           Utils.setOtherid(getActivity(), ""+user_trends.get(pos).getUid());
 *           } });
 * 
 */
@SuppressLint("ValidFragment")
public class AfterLandingMyHomePageFragment extends BaseFragment implements
		IXListViewListener {
	/**
	 * 收藏标记
	 */
	private final int POST_COLLECT = 0;
	/**
	 * 个人中心主页
	 */
	private final int POST_PERSONAL_CENTE_HOME_PAGE = 1;
	/**
	 * 初始化标记（用于判断发送什么方法）
	 */
	private int flags = POST_PERSONAL_CENTE_HOME_PAGE;

	/**
	 * 心情动态动态太长了的话默认显示130个字
	 */
	private int DongTaiZishu = 130;

	private String tag = "AfterLandingMyHomePageMyFragment";
	private XListView1Adapter x1Adapter;
	private XListView xListView1;
	private int page = 0;
	private String pageNum = "4";// 每页数量
	private PersonalCenterHomePageModel personalCenterHomePageModel;
	private PersonalCenterHomePageModel personalCenterHomePageModel2;// 只有第一保存一次
	private String uid;
	private String fid = "-1";
	private String cid;
	private DisplayImageOptions options;
	private FinalBitmap finalBitmap;
	// 数据存放处
	private List<User_trends_Model> user_trends;

	private List<User_trends_Model> list;
	private final int LAYOUT_CLUB = 0;
	private final int LAYOUT_ACTIVITY = 1;
	private final int LAYOUT_UPPICTURE = 2;
	private final int LAYOUT_DONGTAI = 3;
	private final int LAYOUT_RECORD = 4;
	// 点赞成功和失败
	private final int zanSuccess = 5;
	private final int zanShibai = 6;
	// 用于点赞后
	private ImageView change_imageView;// 接受view的
	// 记录收藏项
	private int pos_ = -1;
	private TextView change_text;
	Results results;

	private String ShareImage = null; // 分享的图片
	private int delete_where_dongtai = -1;// 判断删除的是哪一条动态
	private Handler handler = new Handler() {
		@Override
		public void handleMessage(Message msg) {
			try {
				switch (msg.what) {
				case 1:
					Utils.ExitPrgress(getActivity());
					try {
						Utils.showMessage(getActivity(), getResources()
								.getString(R.string.l_net_error));
					} catch (Exception e) {

					}
					xListView1.stopRefresh();
					xListView1.stopLoadMore();
					break;
				case 2:
					Utils.ExitPrgress(getActivity());
					if (flags == POST_PERSONAL_CENTE_HOME_PAGE) {
						if (personalCenterHomePageModel != null
								&& personalCenterHomePageModel.getUser_trends() != null)
							user_trends.addAll(personalCenterHomePageModel
									.getUser_trends());
					} else if (flags == POST_COLLECT) {
						user_trends.addAll(list);
					}

					try {
						xListView1.stopRefresh();
						xListView1.stopLoadMore();
						xListView1.setRefreshTime(""
								+ getResources().getString(R.string.ganggang));
						x1Adapter.notifyDataSetChanged();
					} catch (Exception e) {
						// TODO: handle exception
					}

					break;
				case 3:
					Utils.ExitPrgress(getActivity());
					try {
						Utils.showMessage(getActivity(), getResources()
								.getString(R.string.l_xa10));
						xListView1.stopRefresh();
						xListView1.stopLoadMore();
						xListView1.setRefreshTime(""
								+ getResources().getString(R.string.ganggang));
					} catch (Exception e) {

					}

					break;
				case 5:// 点赞成功
					Utils.ExitPrgress(getActivity());

					try {
						if (results.isRet() == true) {
							int position = msg.getData().getInt("pos");
							// change_view.setSelected(true);
							user_trends.get(position).setIs_praise("1");
							user_trends
									.get(position)
									.setAdmire(
											""
													+ (Integer
															.parseInt(user_trends
																	.get(position)
																	.getAdmire()) + 1));
							change_text.setText(""
									+ user_trends.get(position).getAdmire());
							change_imageView.setSelected(true);
						} else {
							Utils.showMessage(getActivity(), getResources()
									.getString(R.string.wx_zan_false));
						}
					} catch (Exception e) {
						// TODO: handle exception
					}

					break;
				case 7:// 删除动态成功
					Utils.ExitPrgress(getActivity());
					try {

						Utils.showMessage(getActivity(), getResources()
								.getString(R.string.wx_txt_57));
						// ((AfterLandingActivity) (getActivity())).jiazai(9);
						// delete_where_dongtai
						user_trends.remove(delete_where_dongtai);
						x1Adapter.notifyDataSetInvalidated();
					} catch (Exception e) {

					}
					break;
				case 8:// 删除动态失败
					Utils.ExitPrgress(getActivity());
					try {

						Utils.showMessage(getActivity(), getResources()
								.getString(R.string.wx_delete_false));
					} catch (Exception e) {

					}
					break;
				case 9://
					Utils.ExitPrgress(getActivity());
					try {

						Utils.showMessage(getActivity(), getResources()
								.getString(R.string.l_xb12));
					} catch (Exception e) {

					}
					break;
				case 10://
					Utils.ExitPrgress(getActivity());
					try {

						Utils.showMessage(getActivity(), getResources()
								.getString(R.string.wx_shoucang_success));
						if (pos_ != -1) {
							user_trends.get(pos_).setIs_collected(1);
							user_trends
									.get(pos_)
									.setCollect(
											""
													+ (Integer
															.parseInt((user_trends
																	.get(pos_)
																	.getCollect())) + 1));
							x1Adapter.notifyDataSetChanged();
						}

					} catch (Exception e) {

					}
					break;
				case 11://
					Utils.ExitPrgress(getActivity());
					try {

						Utils.showMessage(getActivity(), getResources()
								.getString(R.string.wx_shoucang_false));
					} catch (Exception e) {

					}
					break;
				default:
					break;
				}
			} catch (Exception e) {

			}
		}
	};

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		uid = Utils.getUid(getActivity());
		finalBitmap = FinalBitmap.create(getActivity());
		finalBitmap.configLoadfailImage(R.drawable.noimage);
		finalBitmap.configLoadingImage(R.drawable.noimage);
		// finalBitmap.configLoadingImage(R)
		user_trends = new ArrayList<User_trends_Model>();
		// user_trends.add(new User_trends_Model());
		// personalCenterHomePageModel=new PersonalCenterHomePageModel();
		// initMessage();
		options = new DisplayImageOptions.Builder()
				.showStubImage(R.drawable.ic_stub)
				.showImageForEmptyUri(R.drawable.noimage)
				.showImageOnFail(R.drawable.noimage).cacheInMemory()
				.cacheOnDisc().displayer(new RoundedBitmapDisplayer(5)).build();
		// (PersonalCenterHomePageModel)
		// getArguments().getSerializable("afterLandingMyHomePageMyFragment");
		personalCenterHomePageModel = new PersonalCenterHomePageModel();
		// initData();

		//
	}

	/**
	 * 初始化listView
	 */
	private void initData() {
		if (personalCenterHomePageModel != null) {
			if (personalCenterHomePageModel.getUser_trends() != null) {
				// user_trends=personalCenterHomePageModel.getUser_trends();
				// for(int i=0;i<user_trends.size();i++)
				// {
				//
				//
				// }
			}

		}

	}

	@Override
	public void onDestroy() {
		super.onDestroy();
		ImageLoader.getInstance().clearDiscCache();
		ImageLoader.getInstance().clearMemoryCache();
		System.out.println("zhuye" + "onDestroy清理了沒");
	}

	@Override
	public void onPause() {
		super.onPause();
		ImageLoader.getInstance().clearDiscCache();
		ImageLoader.getInstance().clearMemoryCache();
		System.out.println("zhuye" + "onPause");

	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {

		View view = inflater.inflate(R.layout.xlistview, null);
		InitMyXListView1(view);

		// mListView.setPullLoadEnable(true);

		// mListView.setAdapter(x1Adapter);
		return view;
	}

	public void InitMyXListView1(View view) {
		xListView1 = (XListView) view.findViewById(R.id.my_xListView1);
		xListView1.setXListViewListener(AfterLandingMyHomePageFragment.this);
		xListView1.setPullLoadEnable(true);
		xListView1.setPullRefreshEnable(true);
		xListView1.setDivider(null);
		xListView1.setBackgroundColor(getResources().getColor(
				R.color.gray_eaeaea));
		x1Adapter = new XListView1Adapter();
		xListView1.setAdapter(x1Adapter);
		xListView1.startLoadMore();

	}

	class XListView1Adapter extends BaseAdapter {

		ViewHolder holder;
		int[] layoutId = new int[] { R.layout.chuangjianjulebudongtai,// 创建俱乐部ok
																		// logo
				R.layout.fahuodongdongtai,// 发起活动
				R.layout.up_tupiandongtai,// 上传图片
				R.layout.dongtaiaddtupian,// 动态（图片和文字都有）ok
				R.layout.jiludongtai // 记录动态
		};

		@Override
		public int getCount() {

			return user_trends.size();
		}

		@Override
		public int getItemViewType(int position) {

			try {

				if (!StringUtil.isNullOrEmpty(user_trends.get(position)
						.getType())
						&& user_trends.get(position).getType().equals("club")) {
					return 0;
				} else if (!StringUtil.isNullOrEmpty(user_trends.get(position)
						.getType())
						&& user_trends.get(position).getType()
								.equals("activity")) {
					return 1;
				} else if (!StringUtil.isNullOrEmpty(user_trends.get(position)
						.getType())
						&& user_trends.get(position).getType().equals("photo")) {
					return 2;
				} else

				if (!StringUtil.isNullOrEmpty(user_trends.get(position)
						.getType())
						&& user_trends.get(position).getType()
								.equals("humor_trends"))// humor_trends
				{
					return 3;
				} else if (!StringUtil.isNullOrEmpty(user_trends.get(position)
						.getType())
						&& user_trends.get(position).getType().equals("record")) {
					return 4;
				}

			} catch (Exception e) {

			}

			return 1;

		}

		@Override
		public int getViewTypeCount() {

			return 7;
		}

		@Override
		public Object getItem(int position) {

			if (position != 0)
				return user_trends.get(position);
			else {
				return null;
			}
		}

		@Override
		public long getItemId(int position) {

			return (position);
		}

		@Override
		public View getView(int position, View convertView, ViewGroup parent) {

			// ///////////////////////////////////////////////这个view是看别人空间的

			holder = new ViewHolder();
			LayoutInflater inflater = LayoutInflater.from(getActivity());
			//
			int type = getItemViewType(position);

			if (convertView == null) {

				switch (type) {
				case LAYOUT_CLUB:
					convertView = inflater.inflate(layoutId[0], null);
					initClubId(convertView, holder);
					break;
				case LAYOUT_ACTIVITY:
					convertView = inflater.inflate(layoutId[1], null);
					initActivityId(convertView, holder);
					break;
				case LAYOUT_UPPICTURE:
					convertView = inflater.inflate(layoutId[2], null);
					initUpPictureId(convertView, holder);
					break;
				case LAYOUT_DONGTAI:
					convertView = inflater.inflate(layoutId[3], null);
					initDongTaiId(convertView, holder);
					break;
				case LAYOUT_RECORD:
					convertView = inflater.inflate(layoutId[4], null);
					initRecordId(convertView, holder);
					break;
				// case 5:// 头部
				// convertView = inflater.inflate(
				// R.layout.fragment_after_landing_home_page_my_page1,
				// null);
				// initTopViewId(convertView, holder);
				// break;
				// return convertView;
				}
				convertView.setTag(holder);
			} else {
				holder = (ViewHolder) convertView.getTag();
			}
			int t = getItemViewType(position);
			showdongtai(convertView, holder, position, t);
			// // 这是顶部视图
			// if (getItemViewType(position) == 5) {
			// showTopView(holder);
			// }
			return convertView;

			/**
			 * R.layout.chuangjianjulebudongtai,//创建俱乐部
			 * R.layout.fahuodongdongtai,//发起活动 R.layout.up_tupiandongtai,//上传图片
			 * R.layout.dongtaiaddtupian,//动态（图片和文字都有）
			 * R.layout.jiludongtai//记录动态 //
			 */

		}
	}

	/**
	 * 动态
	 * 
	 * @param convertView
	 */
	private void showdongtai(View convertView, ViewHolder holder, int pos,
			int type) {

		/**
		 * 创建俱乐部动态
		 */
		if (type == LAYOUT_CLUB) {

			CreateClubDongtai(convertView, holder, pos);

		}
		/**
		 * 发起活动
		 */
		if (type == LAYOUT_ACTIVITY) {
			// try {
			PostActivityDongtai(convertView, holder, pos);
			// } catch (Exception e) {
			//
			// }
		}
		/**
		 * 上传图片
		 */
		if (type == LAYOUT_UPPICTURE) {
			// try {
			UpPictureDongtai(convertView, holder, pos);
			// } catch (Exception e) {
			//
			// }
		}

		/**
		 * 动态（图片和文字都有）
		 * 
		 */
		if (type == LAYOUT_DONGTAI) {
			// 心情动态
			// try {
			XinQingDongtai(convertView, holder, pos);
			// } catch (Exception e) {
			//
			// }

		}
		/**
		 * 记录动态
		 */
		if (type == LAYOUT_RECORD) {
			// 记录动态
			// try {
			RecordDongtai(convertView, holder, pos);
			// } catch (Exception e) {
			//
			// }

		}
	}

	/**
	 * 初始化顶部视图id
	 * 
	 * @param convertView
	 * @param holder
	 */
	public void initTopViewId(View convertView, ViewHolder holder) {

		// 加载背景图

		holder.iv_beijing = (ImageView) convertView
				.findViewById(R.id.iv_beijing);

		holder.iv_touxiang = (ImageView) convertView
				.findViewById(R.id.iv_touxiang);
		// tv_motto 座右铭
		holder.tv_motto = (TextView) convertView.findViewById(R.id.tv_motto);

		// 昵称
		holder.tv_nickName = (TextView) convertView
				.findViewById(R.id.tv_nickName);

		// 城市
		holder.tv_city = (TextView) convertView.findViewById(R.id.tv_city);

		// 图片
		holder.t_picture = (TextView) convertView.findViewById(R.id.t_pic);

		// 记录
		holder.t_record = (TextView) convertView.findViewById(R.id.t_record);

		// 俱乐部
		holder.t_club = (TextView) convertView.findViewById(R.id.t_club);

		// 活动
		holder.t_activity = (TextView) convertView
				.findViewById(R.id.t_activity);

		// 朋友
		holder.t_friends = (TextView) convertView.findViewById(R.id.t_friends);
		holder.one = (LinearLayout) convertView.findViewById(R.id.one);
		holder.one_line = (LinearLayout) convertView
				.findViewById(R.id.one_line);
		holder.two = (LinearLayout) convertView.findViewById(R.id.two);
		holder.two_line = (LinearLayout) convertView
				.findViewById(R.id.two_line);
		// 右箭头的
		holder.right = (ImageView) convertView.findViewById(R.id.right);

		holder.left = (ImageView) convertView.findViewById(R.id.left);
		// one
		holder.ll_home_page = (LinearLayout) convertView
				.findViewById(R.id.ll_homepage);// 个人主页
		holder.ll_picture = (LinearLayout) convertView
				.findViewById(R.id.ll_picture);
		holder.ll_record = (LinearLayout) convertView
				.findViewById(R.id.ll_record);
		holder.ll_club = (LinearLayout) convertView.findViewById(R.id.ll_club);
		holder.ll_activity = (LinearLayout) convertView
				.findViewById(R.id.ll_activity);

		// two收藏按钮
		holder.ll_collect = (LinearLayout) convertView
				.findViewById(R.id.ll_collect);
		holder.ll_friends = (LinearLayout) convertView
				.findViewById(R.id.ll_friends);
		holder.ll_data = (LinearLayout) convertView.findViewById(R.id.ll_data);
		holder.ll_otherspace = (LinearLayout) convertView
				.findViewById(R.id.ll_otherspace);
		// public LinearLayout ll_picture;//照片
		// public LinearLayout ll_record;//记录
		// public LinearLayout ll_club;//俱乐部
		// public LinearLayout ll_activity;//活动
		// //two
		// public LinearLayout ll_collect;//收藏
		// public LinearLayout ll_friends;//朋友
		// public LinearLayout ll_data;//资料
		// public LinearLayout ll_otherSpace;//其他空间

	}

	/**
	 * 显示顶部视图，自己的头像，背景等等
	 * 
	 * @param holder
	 */
	public void showTopView(final ViewHolder holder) {

		if (personalCenterHomePageModel2 != null) {
			try {
				// 加载背景图
				ImageLoader.getInstance().displayImage(
						Constants.BadiDownImgUrl + "/"
								+ personalCenterHomePageModel2.getInfo_head()
								+ Constants.Appactivitycover,
						holder.iv_beijing, options);
			} catch (Exception e) {

			}

			try {
				// 头像
				ImageLoader.getInstance().displayImage(
						Constants.BadiDownImgUrl + "/"
								+ personalCenterHomePageModel2.getHead()
								+ Constants.appPhoto4img, holder.iv_touxiang,
						options);

			} catch (Exception e) {

			}

			// tv_motto 座右铭
			holder.tv_motto.setText(""
					+ personalCenterHomePageModel2.getMotto());
			// 昵称
			holder.tv_nickName.setText(""
					+ personalCenterHomePageModel2.getNickName());
			// 城市
			holder.tv_city.setText("" + personalCenterHomePageModel2.getCity());
			// 图片
			holder.t_picture.setText(""
					+ personalCenterHomePageModel2.getPhoto());
			// 记录
			holder.t_record.setText(""
					+ personalCenterHomePageModel2.getTrends());
			// 俱乐部
			holder.t_club.setText("" + personalCenterHomePageModel2.getClubs());
			// 活动
			holder.t_activity.setText(""
					+ personalCenterHomePageModel2.getActivity());
			// 朋友
			holder.t_friends.setText(""
					+ personalCenterHomePageModel2.getFriend());

			// 右箭头的
			holder.right.setOnClickListener(new View.OnClickListener() {

				@Override
				public void onClick(View v) {

					holder.one.setVisibility(View.GONE);
					holder.one_line.setVisibility(View.GONE);
					holder.two.setVisibility(View.VISIBLE);
					holder.two_line.setVisibility(View.VISIBLE);
				}
			});
			holder.left.setOnClickListener(new View.OnClickListener() {

				@Override
				public void onClick(View v) {

					holder.one.setVisibility(View.VISIBLE);
					holder.one_line.setVisibility(View.VISIBLE);
					holder.two.setVisibility(View.GONE);
					holder.two_line.setVisibility(View.GONE);
				}
			});

			// 个人主页
			holder.ll_home_page.setOnClickListener(new View.OnClickListener() {

				@Override
				public void onClick(View v) {

					if (flags != POST_PERSONAL_CENTE_HOME_PAGE) {
						ChageToHomePage(uid, fid);
					}
				}
			});
			// 进入到我的图片
			holder.ll_picture.setOnClickListener(new View.OnClickListener() {

				@Override
				public void onClick(View v) {

					Intent intent = new Intent(getActivity(),
							MyPoly1Activity.class);
					intent.putExtra("uid", uid);
					intent.putExtra("fid", fid);
					getActivity().startActivity(intent);

				}
			});
			// 我的记录
			holder.ll_record.setOnClickListener(new View.OnClickListener() {
				@Override
				public void onClick(View v) {
					Intent intent = new Intent(getActivity(),
							RecordMyRecordListActivity.class);
					intent.putExtra("uid", uid);
					intent.putExtra("fid", fid);
					getActivity().startActivity(intent);

				}
			});
			// 俱乐部
			holder.ll_club.setOnClickListener(new View.OnClickListener() {

				@Override
				public void onClick(View v) {
					Intent intent = new Intent(getActivity(),
							ClubMyClubActivity.class);
					intent.putExtra("uid", uid);
					intent.putExtra("fid", fid);
					getActivity().startActivity(intent);
				}
			});
			// 活动
			holder.ll_activity.setOnClickListener(new View.OnClickListener() {

				@Override
				public void onClick(View v) {
					Intent intent = new Intent(getActivity(),
							CalendarMyActivityActivity.class);
					intent.putExtra("uid", uid);
					intent.putExtra("fid", fid);
					getActivity().startActivity(intent);

				}
			});
			// 收藏按钮
			holder.ll_collect.setOnClickListener(new View.OnClickListener() {

				@Override
				public void onClick(View v) {

					ChageToCollect(uid, fid);

				}
			});
			// 朋友
			holder.ll_friends.setOnClickListener(new View.OnClickListener() {

				@Override
				public void onClick(View v) {

					// 自己的和别人的全是这个
					Intent intent = new Intent(getActivity(),
							PinyinSeeOtherPeopleFriendActivity.class);
					// intent.putExtra("uid", uid);
					// intent.putExtra("fid", fid);
					getActivity().startActivity(intent);
				}
			});
			// 我的资料
			holder.ll_data.setOnClickListener(new View.OnClickListener() {

				@Override
				public void onClick(View v) {

					Intent intent = new Intent(getActivity(),
							MyDataActivity.class);
					intent.putExtra("uid", uid);
					intent.putExtra("fid", fid);

					getActivity().startActivity(intent);
				}
			});
			// 其他空间
			holder.ll_otherspace.setOnClickListener(new View.OnClickListener() {

				@Override
				public void onClick(View v) {

					Intent intent = new Intent(getActivity(),
							MyOtherSpaceActivity.class);
					intent.putExtra("uid", uid);
					intent.putExtra("fid", fid);
					getActivity().startActivity(intent);
				}
			});

			// public LinearLayout ll_home_page;//个人主页
			// public LinearLayout ll_picture;//照片
			// public LinearLayout ll_record;//记录
			// public LinearLayout ll_club;//俱乐部
			// public LinearLayout ll_activity;//活动
			// //two
			// public LinearLayout ll_collect;//收藏
			// public LinearLayout ll_friends;//朋友
			// public LinearLayout ll_data;//资料
			// public LinearLayout ll_otherSpace;//其他空间

		}

	}

	/**
	 * 转为个人主页
	 * 
	 * @param uid2
	 * @param fid2
	 */
	protected void ChageToHomePage(String uid2, String fid2) {

		if (flags != POST_PERSONAL_CENTE_HOME_PAGE) {
			flags = POST_PERSONAL_CENTE_HOME_PAGE;
			this.uid = uid2;
			this.fid = fid2;
			user_trends = new ArrayList<User_trends_Model>();
			user_trends.add(new User_trends_Model());// 这是个站位符号
			page = 0;
			if (xListView1 != null)
				xListView1.startLoadMore();
		}

	}

	/**
	 * 转为收藏
	 * 
	 * @param uid
	 * @param fid
	 */
	public void ChageToCollect(String uid, String fid) {
		if (flags != POST_COLLECT) {
			flags = POST_COLLECT;
			this.uid = uid;
			this.fid = fid;
			user_trends = new ArrayList<User_trends_Model>();
			user_trends.add(new User_trends_Model());// 这是个站位符号
			page = 0;
			if (xListView1 != null)
				xListView1.startLoadMore();
		}
	}

	// TODO Auto-generated method stub
	/**
	 * 初始化记录视图id
	 * 
	 * @param convertView
	 * @param holder
	 */
	public void initRecordId(View convertView, ViewHolder holder) {
		holder.drop_down = (ImageView) convertView.findViewById(R.id.drop_down);
		// 删除和举报按钮
		holder.delete_hands = (Button) convertView
				.findViewById(R.id.delete_hands);
		// 昵称
		holder.nickName = (TextView) convertView.findViewById(R.id.nickName);
		// 内容
		holder.content = (TextView) convertView.findViewById(R.id.content);

		// 发表时间
		holder.time = (TextView) convertView.findViewById(R.id.time);
		// 头像
		holder.head = (ImageView) convertView.findViewById(R.id.head);
		// 头像
		holder.image = (ImageView) convertView.findViewById(R.id.image);
		// 活动开始时间和结束时间
		holder.start_timeaddend_time = (TextView) convertView
				.findViewById(R.id.start_timeaddend_time);
		// 浏览
		holder.view = (TextView) convertView.findViewById(R.id.view);
		// 评论
		holder.discuss = (TextView) convertView.findViewById(R.id.discuss);
		// 收藏
		holder.collect = (TextView) convertView.findViewById(R.id.collect);
		// 是否收藏
		holder.is_collected = (ImageView) convertView
				.findViewById(R.id.is_collected);
		holder.ll_discuss = (LinearLayout) convertView
				.findViewById(R.id.ll_discuss);
		holder.ll_collect = (LinearLayout) convertView
				.findViewById(R.id.ll_collect);
		holder.ll_link = (LinearLayout) convertView.findViewById(R.id.ll_link);
		holder.publish = (TextView) convertView.findViewById(R.id.fabiaoyu);
		holder.name = (TextView) convertView.findViewById(R.id.club_name);
	}

	/**
	 * 显示记录动态
	 * 
	 * @param convertView
	 * @param holder
	 * @param pos
	 */
	public void RecordDongtai(View convertView, final ViewHolder holder,
			final int pos) {
		holder.ll_link.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent(getActivity(),
						LogReadingActivity.class);
				intent.putExtra("rid", user_trends.get(pos).getId());
				intent.putExtra("jilu_fabiao_uid", user_trends.get(pos)
						.getUid());
				getActivity().startActivity(intent);
			}
		});
		// 删除和举报
		if (user_trends.get(pos).getDelete_hands() != null) {
			drop(user_trends, pos, holder.drop_down);
		}

		// 判断是不是发表于俱乐部
		if (!user_trends.get(pos).getCid().equals("0")) {
			holder.publish.setVisibility(View.VISIBLE);
			holder.name.setText(user_trends.get(pos).getName());
			holder.name.setOnClickListener(new OnClickListener() {

				@Override
				public void onClick(View v) {
					Intent intent = new Intent(getActivity(),
							ClubHomepageActivity.class);

					intent.putExtra("cid", user_trends.get(pos).getCid());
					startActivity(intent);

				}
			});
		}

		// 昵称
		holder.nickName.setText("" + user_trends.get(pos).getNickName());
		holder.nickName.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				if (!StringUtil.isNullOrEmpty(user_trends.get(pos).getUid())) {
					if (user_trends.get(pos).getUid()
							.equals("" + Utils.getUid(getActivity()))) {
						// ((AfterLandingActivity) (getActivity())).jiazai(9);
						Intent intent = new Intent(getActivity(),
								MyDataActivity.class);
						// intent.putExtra("isStartTwoClose", true);
						startActivity(intent);

					} else {
						Intent intent = new Intent(getActivity(),
								SeeOtherPeopleSpaceActivity.class);
						intent.putExtra("friend_id", user_trends.get(pos)
								.getUid());

						startActivity(intent);
					}
				}

			}
		});
		// 发表时间
		holder.time.setText(""
				+ CalendarTools.getTimeChangeToString(getActivity(),
						user_trends.get(pos).getTime()));
		// 头像
		try {
			ImageLoader.getInstance().displayImage(
					Constants.BadiDownImgUrl + "/"
							+ user_trends.get(pos).getHead()
							+ Constants.appPhoto4img, holder.head, options);

		} catch (Exception e) {
		}

		holder.head.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				if (!StringUtil.isNullOrEmpty(user_trends.get(pos).getUid())) {
					if (user_trends.get(pos).getUid()
							.equals("" + Utils.getUid(getActivity()))) {
						// ((AfterLandingActivity) (getActivity())).jiazai(9);
						Intent intent = new Intent(getActivity(),
								MyDataActivity.class);
						// intent.putExtra("isStartTwoClose", true);
						startActivity(intent);

					} else {
						Intent intent = new Intent(getActivity(),
								SeeOtherPeopleSpaceActivity.class);
						intent.putExtra("friend_id", user_trends.get(pos)
								.getUid());

						startActivity(intent);
					}
				}

			}
		});
		try {
			ImageLoader.getInstance().displayImage(
					Constants.BadiDownImgUrl + "/"
							+ user_trends.get(pos).getImage()
							+ Constants.App9block, holder.image, options);
		} catch (Exception e) {

		}

		// finalBitmap.display(holder.image, Constants.BadiDownImgUrl + "/"
		// + user_trends.get(pos).getImage());
		// <<<<<<< .mine
		// // 活动开始时间和结束时间
		// if(user_trends.get(pos).getStart_time()!=null &&
		// user_trends.get(pos).getEnd_time()!=null)
		// {
		// String
		// start_time=(user_trends.get(pos).getStart_time().replaceAll("-",
		// ".")).substring(0, 10);
		// String end_time=(user_trends.get(pos).getEnd_time().replaceAll("-",
		// ".")).substring(0, 10);
		// holder.start_timeaddend_time.setText(""
		// + start_time + "-"
		// + end_time);
		// }
		//
		// =======
		// 活动开始时间和结束时间
		holder.start_timeaddend_time.setText(""
				+ Utils.Back_Data(user_trends.get(pos).getStart_time()) + "-"
				+ Utils.Back_Data(user_trends.get(pos).getEnd_time()));
		// >>>>>>> .r244
		// 浏览
		holder.view.setText("" + user_trends.get(pos).getView());
		// 评论
		holder.discuss.setText("" + user_trends.get(pos).getDiscuss());
		// 收藏
		holder.collect.setText("" + user_trends.get(pos).getCollect());
		holder.content.setText("" + user_trends.get(pos).getTitle());
		holder.ll_discuss.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				// User_trends_Model u = user_trends.get(pos);
				// String path = IOUtils
				// .getSavePinLunObjectPath(getActivity());
				// // 将序列化对象写入sdcard 在AfterLandingDongTaiDiscussFragment中去
				// IOUtils.WriteSerializedObjectsToSDcard(path, (Object) u);
				//
				// ((AfterLandingActivity) (getActivity())).jiazai(7);

			}
		});

		if (flags == POST_COLLECT) {
			user_trends.get(pos).setIs_collected(1);
		}
		if (user_trends.get(pos).getIs_collected() == 1) {
			holder.is_collected.setSelected(true);
			holder.is_collected.setOnClickListener(new View.OnClickListener() {

				@Override
				public void onClick(View v) {
					// TODO Auto-generated method stub

				}
			});
		} else {
			holder.is_collected.setSelected(false);
			holder.is_collected.setOnClickListener(new View.OnClickListener() {

				@Override
				public void onClick(View v) {
					// TODO Auto-generated method stub
					pos_ = pos;
					//
					// + user_trends.get(pos).getId() + "/"
					// + user_trends.get(pos).getType());
					collect("0", user_trends.get(pos).getUid(), user_trends
							.get(pos).getId(), user_trends.get(pos).getType());
				}
			});
		}
		// //缺活动时间
		// //'record' 对应的属性
		// //public String type;//类型 用于判断接收返回值是选用的model
		// public TextView view;//浏览次数
		// //public String discuss;//评论次数
		// //public String collect;//收藏次数
		// //public String id;//该记录的id
		// //public String time;//记录添加时间
		// public ImageView image;//封面图
		// public TextView content;//记录的内容
		// //public String delete_hands;//自己 为删除 别的人 举报
		// //public String nickName;//发表信息用户昵称
		// //private String holder.head//发表信息用户头像
		// //private String uid//发表信息的用户id
		// public String start_time;//开始时间
		// public String end_time;//结束时间
	}

	// TODO Auto-generated method stub
	/**
	 * 初始化俱乐部id
	 * 
	 * @param convertView
	 * @param holder
	 */
	private void initClubId(View convertView, ViewHolder holder) {
		holder.drop_down = (ImageView) convertView.findViewById(R.id.drop_down);
		holder.fenxiang_or_yuanchuang = (TextView) convertView
				.findViewById(R.id.fenxiang_or_yuanchuang);
		/**
		 * zan
		 */
		holder.is_praise = (ImageView) convertView.findViewById(R.id.is_praise);

		// //是否收藏
		// holder.is_collected=(ImageView)convertView.findViewById(R.id.is_collected);
		// 昵称
		holder.nickName = (TextView) convertView.findViewById(R.id.nickName);
		// 删除和举报按钮
		holder.delete_hands = (Button) convertView
				.findViewById(R.id.delete_hands);
		// 头像
		holder.head = (ImageView) convertView.findViewById(R.id.head);
		// 发表时间
		holder.time = (TextView) convertView.findViewById(R.id.time);
		// 俱乐部名
		holder.name = (TextView) convertView.findViewById(R.id.name);
		// 俱乐部地址
		holder.originate_address = (TextView) convertView
				.findViewById(R.id.originate_address);
		// 俱乐部种类
		holder.typeName = (TextView) convertView.findViewById(R.id.typeName);
		// 加入俱乐部需要的金币数量
		holder.price = (TextView) convertView.findViewById(R.id.price);
		// 获赞次数
		holder.admire = (TextView) convertView.findViewById(R.id.admire);
		// 评论次数
		holder.discuss = (TextView) convertView.findViewById(R.id.discuss);
		// // 收藏次数
		// holder.collect = (TextView) convertView.findViewById(R.id.collect);
		// 分享次数
		holder.share = (TextView) convertView.findViewById(R.id.share);
		// LOGO
		holder.logo = (ImageView) convertView.findViewById(R.id.logo);
		// 评论
		//
		holder.ll_admire = (LinearLayout) convertView
				.findViewById(R.id.ll_admire);
		holder.ll_discuss = (LinearLayout) convertView
				.findViewById(R.id.ll_discuss);
		// holder.ll_collect = (LinearLayout) convertView
		// .findViewById(R.id.ll_collect);
		holder.ll_share = (LinearLayout) convertView
				.findViewById(R.id.ll_share);
		holder.ll_link = (LinearLayout) convertView.findViewById(R.id.ll_link);
		// public LinearLayout ll_admire,ll_dicuss,ll_share;//ll_collect,
	}

	/**
	 * 显示创建俱乐部动态
	 * 
	 * @param convertView
	 * @param holder
	 * @param pos
	 */
	public void CreateClubDongtai(final View convertView,
			final ViewHolder holder, final int pos) {

		holder.ll_link.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent(getActivity(),
						ClubHomepageActivity.class);

				intent.putExtra("cid", user_trends.get(pos).getCid());
				startActivity(intent);
			}
		});

		// 分享还是原创的
		if (user_trends.get(pos).getTrends_type().equals("yuanchuang")) {
			holder.fenxiang_or_yuanchuang.setText("");
		} else {
			holder.fenxiang_or_yuanchuang.setText(getResources().getString(
					R.string.wx_txt_58));
		}
		// 昵称
		holder.nickName.setText("" + user_trends.get(pos).getNickName());
		holder.nickName.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				if (!StringUtil.isNullOrEmpty(user_trends.get(pos).getUid())) {
					if (user_trends.get(pos).getUid()
							.equals("" + Utils.getUid(getActivity()))) {
						// ((AfterLandingActivity) (getActivity())).jiazai(9);
						Intent intent = new Intent(getActivity(),
								MyDataActivity.class);
						// intent.putExtra("isStartTwoClose", true);
						startActivity(intent);

					} else {
						Intent intent = new Intent(getActivity(),
								SeeOtherPeopleSpaceActivity.class);
						intent.putExtra("friend_id", user_trends.get(pos)
								.getUid());

						startActivity(intent);
					}
				}

			}
		});
		// 是否已经赞过
		if (user_trends.get(pos).getIs_praise().equals("1")) {
			holder.is_praise.setSelected(true);
			holder.is_praise.setOnClickListener(new OnClickListener() {

				@Override
				public void onClick(View v) {

				}
			});

		} else // 0未赞
		{
			holder.is_praise.setSelected(false);
			holder.is_praise.setOnClickListener(new OnClickListener() {

				@Override
				public void onClick(View v) {

					// change_viewHolder = holder;
					change_imageView = holder.is_praise;
					change_text = holder.admire;
					dianzan(getActivity(), Utils.getUid(getActivity()),
							user_trends.get(pos).getId(), user_trends.get(pos)
									.getUid(), user_trends.get(pos).getType(),
							pos);

				}
			});
		}

		// 删除和举报
		if (user_trends.get(pos).getDelete_hands() != null) {
			drop(user_trends, pos, holder.drop_down);
		}
		try {
			// 头像
			ImageLoader.getInstance().displayImage(
					Constants.BadiDownImgUrl + "/"
							+ user_trends.get(pos).getHead()
							+ Constants.appPhoto4img, holder.head, options);
		} catch (Exception e) {

		}
		holder.head.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				if (user_trends.get(pos).getUid()
						.equals(Utils.getUid(getActivity()))) {
					// ((AfterLandingActivity) (getActivity())).jiazai(9);
					Intent intent = new Intent(getActivity(),
							MyDataActivity.class);
					// intent.putExtra("isStartTwoClose", true);
					startActivity(intent);

				} else {
					// Utils.setOtherid(getActivity(), ""
					// + user_trends.get(pos).getUid());
					// ((AfterLandingActivity) (getActivity())).jiazai(11);
					Intent intent = new Intent(getActivity(),
							SeeOtherPeopleSpaceActivity.class);
					intent.putExtra("friend_id", user_trends.get(pos).getUid());

					startActivity(intent);
				}
			}
		});
		// 发表时间
		holder.time.setText(""
				+ CalendarTools.getTimeChangeToString(getActivity(),
						user_trends.get(pos).getTime()));
		// 俱乐部名
		holder.name.setText("" + user_trends.get(pos).getName());

		// 俱乐部地址
		holder.originate_address.setText(""
				+ user_trends.get(pos).getOriginate_address());
		// 俱乐部种类
		holder.typeName.setText("" + user_trends.get(pos).getType_name());

		// 加入俱乐部需要的金币数量
		holder.price.setText("" + user_trends.get(pos).getPrice());

		// 获赞次数
		holder.admire.setText("" + user_trends.get(pos).getAdmire());
		// 评论次数
		holder.discuss.setText("" + user_trends.get(pos).getDiscuss());
		// // 收藏次数
		// holder.collect.setText("" + user_trends.get(pos).getCollect());
		// 分享次数
		holder.share.setText("" + user_trends.get(pos).getShare());
		// LOGO
		try {
			ImageLoader.getInstance().displayImage(
					Constants.BadiDownImgUrl + "/"
							+ user_trends.get(pos).getLogo()
							+ Constants.App9block, holder.logo, options);
		} catch (Exception e) {

		}
		// 点击赞
		holder.ll_admire.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {

				// 收费的
			}
		});
		// 点击评论
		holder.ll_discuss.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				// User_trends_Model u = user_trends.get(pos);
				// String path = IOUtils.getSavePinLunObjectPath(getActivity());
				// // 将序列化对象写入sdcard 在AfterLandingDongTaiDiscussFragment中去
				// IOUtils.WriteSerializedObjectsToSDcard(path, (Object) u);
				//
				// ((AfterLandingActivity) (getActivity())).jiazai(7);
				Intent intent = new Intent(getActivity(),
						LookAtTheDetailedActivity.class);
				intent.putExtra("User_trends_Model", user_trends.get(pos));
				startActivity(intent);
			}
		});
		// // 点击收藏
		// holder.ll_collect.setOnClickListener(new OnClickListener() {
		//
		// @Override
		// public void onClick(View v) {
		//
		// }
		// });
		// 分享
		holder.ll_share.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				if (!StringUtil.isNullOrEmpty(user_trends.get(pos).getLogo())) {
					ShareSDKTools.ShowOneKeyShare(
							getActivity(),
							"分享",
							user_trends.get(pos).getName(),
							"",
							Constants.BadiDownImgUrl + "/"
									+ user_trends.get(pos).getLogo(), "club",
							user_trends.get(pos).getId(), user_trends.get(pos)
									.getUid(), "0", "club");
				} else {
					ShareSDKTools.ShowOneKeyShare(getActivity(), "分享",
							user_trends.get(pos).getName(), "", "", "club",
							user_trends.get(pos).getId(), user_trends.get(pos)
									.getUid(), "0", "club");
				}
				ShareSDKTools
						.setOnShareFinishCallBack(new ShareSDKTools.CallBack() {

							@Override
							public void ShareFinishCallBack() {
								// TODO Auto-generated method stub
								int a = Integer.parseInt(user_trends.get(pos)
										.getShare());
								user_trends.get(pos).setShare("" + (a + 1));

								try {
									x1Adapter.notifyDataSetChanged();

								} catch (Exception e) {
									// TODO: handle exception
								}

							}
						});
			}
		});
		// finalBitmap.display(holder.logo, Constants.BadiDownImgUrl + "/"
		// + user_trends.get(pos).getLogo());
		// 缺俱乐部类型
		// 赞
		// 评论
		// 分享
		// 收藏

		// //'club' 对应的属性 （俱乐部)
		// private TextView nickName;//用户昵称
		// private ImageView head;//用户头像
		// private String uid;//发表信息的用户id
		// private String cid;//俱乐部id
		// private String name;//俱乐部名称
		// private String logo;//俱乐部logo
		// private String originate_address;//俱乐部地址
		// private String price;//俱乐部加入所需金币
		// private Button delete_hands;//自己 为删除 别的人 举报
		// //private String time;

		// private String discuss; //评论
		// private String admire; //赞
		// private String collect; //收藏
		// private String share; //分享
		// private String typeName;//俱乐部类型
	}

	// TODO Auto-generated method stub
	/**
	 * 初始化上传图片id
	 * 
	 * @param convertView
	 * @param holder
	 */
	public void initUpPictureId(View convertView, ViewHolder holder) {
		holder.drop_down = (ImageView) convertView.findViewById(R.id.drop_down);
		/**
		 * 是否已经赞过了
		 */
		holder.is_praise = (ImageView) convertView.findViewById(R.id.is_praise);
		holder.head = (ImageView) convertView.findViewById(R.id.head);
		// 昵称
		holder.nickName = (TextView) convertView.findViewById(R.id.nickName);
		// 发表时间
		holder.time = (TextView) convertView.findViewById(R.id.time);
		// 删除和举报按钮
		holder.delete_hands = (Button) convertView
				.findViewById(R.id.delete_hands);
		// 获赞次数
		holder.reprint = (TextView) convertView.findViewById(R.id.reprint);
		// 评论次数
		holder.comment = (TextView) convertView.findViewById(R.id.comment);
		// 上传图片次数
		holder.img_count = (TextView) convertView.findViewById(R.id.img_count);
		// 到哪一个相册
		holder.photo_name = (TextView) convertView
				.findViewById(R.id.photo_name);
		// 九张小图
		holder.gv_xinqingpicture = (GridView) convertView
				.findViewById(R.id.xinqingpicture);

		// 用来计算图片的宽
		holder.l_width = (LinearLayout) convertView.findViewById(R.id.l_width);
		holder.ll_discuss = (LinearLayout) convertView
				.findViewById(R.id.ll_discuss);
		holder.ll_link = (LinearLayout) convertView.findViewById(R.id.ll_link);
	}

	/**
	 * 显示上传图片动态
	 * 
	 * @param convertView
	 * @param holder
	 * @param pos
	 */
	public void UpPictureDongtai(final View convertView,
			final ViewHolder holder, final int pos) {

		holder.ll_link.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				if (user_trends.get(pos).getUid()
						.equals(Utils.getUid(getActivity()))) {
					Intent intent = new Intent(getActivity(),
							MyPoly1Activity.class);
					startActivity(intent);
				} else {
					Intent intent = new Intent(getActivity(),
							SeeOtherPeoplePolyActivity.class);
					intent.putExtra("uid", user_trends.get(pos).getUid());
					startActivity(intent);
				}

			}
		});

		int w = (int) Utils.GetAssemblyWidth(holder.l_width);
		//

		// 是否已经赞过
		// 是否已经赞过
		if (user_trends.get(pos).getIs_praise().equals("1")) {
			holder.is_praise.setSelected(true);
			holder.is_praise.setOnClickListener(new OnClickListener() {

				@Override
				public void onClick(View v) {

				}
			});

		} else // 0未赞
		{
			holder.is_praise.setSelected(false);
			holder.is_praise.setOnClickListener(new OnClickListener() {

				@Override
				public void onClick(View v) {

					change_imageView = holder.is_praise;
					change_text = holder.admire;
					dianzan(getActivity(), Utils.getUid(getActivity()),
							user_trends.get(pos).getId(), user_trends.get(pos)
									.getUid(), user_trends.get(pos).getType(),
							pos);

				}
			});
		}
		try {
			ImageLoader.getInstance().displayImage(
					Constants.BadiDownImgUrl + "/"
							+ user_trends.get(pos).getHead()
							+ Constants.appPhoto4img, holder.head, options);
		} catch (Exception e) {

		}
		holder.head.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				if (user_trends.get(pos).getUid()
						.equals(Utils.getUid(getActivity()))) {
					// ((AfterLandingActivity) (getActivity())).jiazai(9);
					Intent intent = new Intent(getActivity(),
							MyDataActivity.class);
					// intent.putExtra("isStartTwoClose", true);
					startActivity(intent);

				} else {
					// Utils.setOtherid(getActivity(), ""
					// + user_trends.get(pos).getUid());
					// ((AfterLandingActivity) (getActivity())).jiazai(11);
					Intent intent = new Intent(getActivity(),
							SeeOtherPeopleSpaceActivity.class);
					intent.putExtra("friend_id", user_trends.get(pos).getUid());

					startActivity(intent);
				}
			}
		});
		// 昵称
		holder.nickName.setText("" + user_trends.get(pos).getNickName());
		holder.nickName.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				if (!StringUtil.isNullOrEmpty(user_trends.get(pos).getUid())) {
					if (user_trends.get(pos).getUid()
							.equals("" + Utils.getUid(getActivity()))) {
						// ((AfterLandingActivity) (getActivity())).jiazai(9);
						Intent intent = new Intent(getActivity(),
								MyDataActivity.class);
						// intent.putExtra("isStartTwoClose", true);
						startActivity(intent);

					} else {
						Intent intent = new Intent(getActivity(),
								SeeOtherPeopleSpaceActivity.class);
						intent.putExtra("friend_id", user_trends.get(pos)
								.getUid());

						startActivity(intent);
					}
				}

			}
		});
		// 发表时间
		holder.time.setText(""
				+ CalendarTools.getTimeChangeToString(getActivity(),
						user_trends.get(pos).getTime()));
		// 删除和举报
		if (user_trends.get(pos).getDelete_hands() != null) {
			drop(user_trends, pos, holder.drop_down);
		}
		// 获赞次数
		holder.reprint.setText("" + user_trends.get(pos).getReprint());
		// 评论次数
		holder.comment.setText("" + user_trends.get(pos).getComment());

		// 上传图片次数
		holder.img_count.setText("" + user_trends.get(pos).getImg_count());
		// 到哪一个相册
		holder.photo_name.setText("" + user_trends.get(pos).getPhoto_name());
		holder.photo_name.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent(getActivity(),
						UpPicturesActivity.class);
				intent.putExtra("photoid", user_trends.get(pos).getId());
				startActivity(intent);
			}
		});
		int wh = (w / 3 - 2);

		holder.ll_discuss.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				// User_trends_Model u = user_trends.get(pos);
				// String path = IOUtils.getSavePinLunObjectPath(getActivity());
				// // 将序列化对象写入sdcard 在AfterLandingDongTaiDiscussFragment中去
				// IOUtils.WriteSerializedObjectsToSDcard(path, (Object) u);
				//
				// ((AfterLandingActivity) (getActivity())).jiazai(7);
				Intent intent = new Intent(getActivity(),
						LookAtTheDetailedActivity.class);
				intent.putExtra("User_trends_Model", user_trends.get(pos));
				startActivity(intent);
			}
		});

		// 图片的
		if (user_trends.get(pos).getImg() != null) {
			holder.gv_xinqingpicture.setVisibility(View.VISIBLE);
			String[] img = new String[user_trends.get(pos).getImg().size()];
			for (int i = 0; i < user_trends.get(pos).getImg().size(); i++) {
				img[i] = user_trends.get(pos).getImg().get(i).getPath();
			}
			GridViewSHUZHUAdapter shuzhuAdapter = new GridViewSHUZHUAdapter(
					getActivity(), img);
			holder.gv_xinqingpicture.setAdapter(shuzhuAdapter);
			holder.gv_xinqingpicture
					.setOnItemClickListener(new AdapterView.OnItemClickListener() {

						@Override
						public void onItemClick(AdapterView<?> arg0, View view,
								int position, long arg3) {
							// TODO Auto-generated method stub
							// user_trends.get(pos).getImg().get(position).getPath();

							Intent intent = new Intent(getActivity(),
									PicturePreviewActivity.class);
							List<BrowseAllPhoto_Model> ll = new ArrayList<BrowseAllPhoto_Model>();
							for (int i = 0; i < user_trends.get(pos).getImg()
									.size(); i++) {
								BrowseAllPhoto_Model bm = new BrowseAllPhoto_Model();
								bm.setId(user_trends.get(pos).getImg().get(i)
										.getId());
								bm.setPath(user_trends.get(pos).getImg().get(i)
										.getPath());
								ll.add(bm);
							}
							intent.putExtra("picture_list", (Serializable) ll);
							intent.putExtra("picture_postion", position);
							getActivity().startActivity(intent);

						}
					});
		} else {
			holder.gv_xinqingpicture.setVisibility(View.GONE);
		}

	}

	// TODO Auto-generated method stub
	/**
	 * 初始化心情动态id
	 * 
	 * @param convertView
	 * @param holder
	 */
	public void initDongTaiId(View convertView, ViewHolder holder) {
		holder.drop_down = (ImageView) convertView.findViewById(R.id.drop_down);
		holder.fenxiang_or_yuanchuang = (TextView) convertView
				.findViewById(R.id.fenxiang_or_yuanchuang);

		// 是否收藏
		holder.is_collected = (ImageView) convertView
				.findViewById(R.id.is_collected);

		// 显示上传的图片
		holder.gv_xinqingpicture = (GridView) convertView
				.findViewById(R.id.xinqingpicture);
		/**
		 * 是否已经赞过了
		 */
		holder.is_praise = (ImageView) convertView.findViewById(R.id.is_praise);
		// 详细
		holder.xiangxi = (TextView) convertView.findViewById(R.id.xiangxi);
		// 昵称
		holder.nickName = (TextView) convertView.findViewById(R.id.nickName);
		// 头像
		holder.head = (ImageView) convertView.findViewById(R.id.head);
		// 昵称
		holder.addtime = (TextView) convertView.findViewById(R.id.addtime);
		// 内容
		holder.contents = (TextView) convertView.findViewById(R.id.contents);
		// 删除和举报按钮
		holder.delete_hands = (Button) convertView
				.findViewById(R.id.delete_hands);
		// 地点
		holder.address = (TextView) convertView.findViewById(R.id.address);
		// 获赞次数
		holder.admire = (TextView) convertView.findViewById(R.id.admire);
		// 评论次数
		holder.discuss = (TextView) convertView.findViewById(R.id.discuss);
		// 发表时间
		holder.addtime = (TextView) convertView.findViewById(R.id.addtime);
		// 收藏次数
		holder.collect = (TextView) convertView.findViewById(R.id.collect);
		// 分享次数
		holder.share = (TextView) convertView.findViewById(R.id.share);
		//
		holder.ll_admire = (LinearLayout) convertView
				.findViewById(R.id.ll_admire);
		holder.ll_discuss = (LinearLayout) convertView
				.findViewById(R.id.ll_discuss);
		holder.ll_collect = (LinearLayout) convertView
				.findViewById(R.id.ll_collect);
		holder.ll_share = (LinearLayout) convertView
				.findViewById(R.id.ll_share);
		holder.ll_link = (LinearLayout) convertView.findViewById(R.id.ll_link);
		holder.xinqingaddress = (TextView) convertView
				.findViewById(R.id.xinqinaddress);
		holder.pictureNum = (TextView) convertView
				.findViewById(R.id.pictureNum);
		holder.publish = (TextView) convertView.findViewById(R.id.fabiaoyu);
		holder.name = (TextView) convertView.findViewById(R.id.club_name);

		holder.videoimage = (ImageView) convertView
				.findViewById(R.id.videoimage);
		holder.videotitle = (TextView) convertView
				.findViewById(R.id.videotitle);
		holder.videoxianshi = (LinearLayout) convertView
				.findViewById(R.id.videoxianshi);
	}

	/**
	 * 显示心情动态
	 * 
	 * @param convertView
	 * @param holder
	 * @param pos
	 */
	public void XinQingDongtai(final View convertView, final ViewHolder holder,
			final int pos) {
		holder.pictureNum.setVisibility(View.GONE);
		// 分享还是原创的
		if (user_trends.get(pos).getTrends_type().equals("yuanchuang")) {
			holder.fenxiang_or_yuanchuang.setText("");
		} else {
			holder.fenxiang_or_yuanchuang.setText(getResources().getString(
					R.string.wx_txt_58));
		}
		try {
			// 心情动态图片显示","隔开
			if (user_trends != null)
				if (!StringUtil.isNullOrEmpty(user_trends.get(pos)
						.getTrends_img())) {

					holder.gv_xinqingpicture.setVisibility(View.VISIBLE);
					String xinqingtupians = user_trends.get(pos)
							.getTrends_img();

					String xinqingids = user_trends.get(pos).getImgIdStr();
					String[] xinqingtupian = xinqingtupians.split(",");

					String[] xinqingid = xinqingids.split(",");
					if (xinqingid.length > 9) {
						holder.pictureNum.setVisibility(View.VISIBLE);
						String a = String.format(
								getResources().getString(R.string.wx2_13), ""
										+ xinqingid.length);
						holder.pictureNum.setText(a);
					} else {
						holder.pictureNum.setVisibility(View.GONE);
					}

					final GridViewSHUZHUAdapter adapter = new GridViewSHUZHUAdapter(
							getActivity(), xinqingtupian, xinqingid);
					holder.gv_xinqingpicture.setAdapter(adapter);
					holder.gv_xinqingpicture
							.setOnItemClickListener(new OnItemClickListener() {

								@Override
								public void onItemClick(AdapterView<?> arg0,
										View arg1, int position, long arg3) {
									// TODO Auto-generated method stub
									Intent intent = new Intent(getActivity(),
											PicturePreviewActivity.class);
									intent.putExtra("picture_list",
											(Serializable) adapter
													.getBrowseAllPhoto_Model());
									intent.putExtra("picture_postion", position);
									startActivity(intent);
								}
							});

					if (xinqingtupian[0] != null)
						ShareImage = xinqingtupian[0];
				} else {
					holder.gv_xinqingpicture.setVisibility(View.GONE);
				}

			// 是否已经赞过
			if (user_trends.get(pos).getIs_praise().equals("1")) {
				holder.is_praise.setSelected(true);
				holder.is_praise.setOnClickListener(new OnClickListener() {

					@Override
					public void onClick(View v) {

					}
				});

			} else // 0未赞
			{
				holder.is_praise.setSelected(false);
				holder.is_praise.setOnClickListener(new OnClickListener() {

					@Override
					public void onClick(View v) {

						change_imageView = holder.is_praise;
						change_text = holder.admire;
						dianzan(getActivity(), Utils.getUid(getActivity()),
								user_trends.get(pos).getId(),
								user_trends.get(pos).getUid(),
								user_trends.get(pos).getType(), pos);

					}
				});
			}
		} catch (Exception e) {
			// TODO: handle exception
		}

		// // 点击头像后头像进入到资料
		// if
		// (!Utils.getUid(getActivity()).equals(user_trends.get(pos).getUid()))
		// {
		// holder.head.setOnClickListener(new View.OnClickListener() {
		//
		// @Override
		// public void onClick(View v) {
		// Utils.setOtherid(getActivity(), ""+user_trends.get(pos).getUid());
		// ((AfterLandingActivity)(getActivity())).jiazai(11);
		// }
		// });
		// }

		try {
			if (user_trends.get(pos).getVideo_str() != null) {

	
				holder.videoxianshi.setVisibility(View.VISIBLE);
				ImageLoader.getInstance().displayImage(

				user_trends.get(pos).getVideo_str().getImg().getLarge(),
						holder.videoimage, options);
				holder.videotitle.setText(""
						+ user_trends.get(pos).getVideo_str().getTitle());
				holder.videoxianshi.setOnClickListener(new OnClickListener() {

					@Override
					public void onClick(View v) {

						// 跳转网页

						Uri uri = Uri.parse(user_trends.get(pos).getVideo_str()
								.getUrl());
						Intent intent = new Intent(Intent.ACTION_VIEW, uri);
						
						startActivity(intent);

					}
				});

			}else{

				holder.videoxianshi.setVisibility(View.GONE);
			}
			

		} catch (Exception e) {

		}
		try {

			// 判断是不是发表于俱乐部
			if ((!user_trends.get(pos).getCid().equals("0"))
					&& (user_trends.get(pos).getName() != null)) {
				holder.publish.setVisibility(View.VISIBLE);
				holder.name.setVisibility(View.VISIBLE);
				holder.name.setText(user_trends.get(pos).getName());
				holder.name.setOnClickListener(new OnClickListener() {

					@Override
					public void onClick(View v) {
						Intent intent = new Intent(getActivity(),
								ClubHomepageActivity.class);

						intent.putExtra("cid", user_trends.get(pos).getCid());
						startActivity(intent);

					}
				});
			} else {
				holder.publish.setVisibility(View.INVISIBLE);
				holder.name.setVisibility(View.INVISIBLE);
			}
		} catch (Exception e) {
			// TODO: handle exception
		}

		// 头像
		try {
			ImageLoader.getInstance().displayImage(
					Constants.BadiDownImgUrl + "/"
							+ user_trends.get(pos).getHead()
							+ Constants.appPhoto4img, holder.head, options);
		} catch (Exception e) {

		}
		holder.head.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				if (user_trends.get(pos).getUid()
						.equals(Utils.getUid(getActivity()))) {
					// ((AfterLandingActivity) (getActivity())).jiazai(9);
					Intent intent = new Intent(getActivity(),
							MyDataActivity.class);
					// intent.putExtra("isStartTwoClose", true);
					startActivity(intent);

				} else {
					// Utils.setOtherid(getActivity(), ""
					// + user_trends.get(pos).getUid());
					// ((AfterLandingActivity) (getActivity())).jiazai(11);

					Intent intent = new Intent(getActivity(),
							SeeOtherPeopleSpaceActivity.class);
					intent.putExtra("friend_id", user_trends.get(pos).getUid());

					startActivity(intent);
				}
			}
		});
		// finalBitmap.display(holder.head, Constants.BadiDownImgUrl + "/"
		// + user_trends.get(pos).getHead());
		// 昵称

		
		holder.nickName.setText("" + user_trends.get(pos).getNickName());
		holder.nickName.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) { 
				if (!StringUtil.isNullOrEmpty(user_trends.get(pos).getUid())) {
					if (user_trends.get(pos).getUid()
							.equals("" + Utils.getUid(getActivity()))) { // ((AfterLandingActivity)(getActivity())).jiazai(9);
						Intent intent = new Intent(getActivity(),
								MyDataActivity.class); // intent.putExtra("isStartTwoClose",
														// true);
						startActivity(intent);

					} else {
						Intent intent = new Intent(getActivity(),
								SeeOtherPeopleSpaceActivity.class);
						intent.putExtra("friend_id", user_trends.get(pos)
								.getUid());

						startActivity(intent);
					}
				}

			}
		});
		 

		// 点击内容后进入到资料
		if (!Utils.getUid(getActivity()).equals(user_trends.get(pos).getUid())) {
			holder.contents.setOnClickListener(new View.OnClickListener() {

				@Override
				public void onClick(View v) {

					// ((AfterLandingActivity) getActivity()).jiazai(11);12
				}
			});
		} else {
			holder.contents.setOnClickListener(new View.OnClickListener() {
				@Override
				public void onClick(View v) {

				}
			});
		}
		if (user_trends.get(pos).getContents() != null) {

			String str = SinaExpressionTools
					.replaceAllPathToReplace(user_trends.get(pos).getContents()
							.toString());
			//
			
			int logs = str.length();
			System.out.println(pos+"logs"+logs);
			if (logs > DongTaiZishu) {

				String ss = str.substring(0, DongTaiZishu);
				//
				String contentss = SinaExpressionTools
						.replaceAllReplaceToPath(ss);
				//
				new HtmlUtils(getActivity(), holder.contents, contentss)
						.showTextView();
				// holder.contents.setEllipsize(TruncateAt.END);
				// holder.contents.setMaxEms(DongTaiZishu);
				// holder.contents.setSingleLine(false);
				holder.xiangxi.setVisibility(View.VISIBLE);
				holder.xiangxi.setOnClickListener(new View.OnClickListener() {
					@Override
					public void onClick(View v) {
						// 这是点击详细
						// User_trends_Model u = user_trends.get(pos);
						// String path = IOUtils
						// .getSavePinLunObjectPath(getActivity());
						// // 将序列化对象写入sdcard
						// 在AfterLandingDongTaiDiscussFragment中去
						// IOUtils.WriteSerializedObjectsToSDcard(path, (Object)
						// u);
						//
						// ((AfterLandingActivity) (getActivity())).jiazai(7);
						Intent intent = new Intent(getActivity(),
								LookAtTheDetailedActivity.class);
						intent.putExtra("User_trends_Model",
								user_trends.get(pos));
						intent.putExtra("ShowSuoQi", true);
						startActivity(intent);

					}
				});
			} else {
				new HtmlUtils(getActivity(), holder.contents, user_trends.get(
						pos).getContents()).showTextView();
				holder.xiangxi.setVisibility(View.GONE);
				holder.xiangxi.setOnClickListener(new View.OnClickListener() {
					@Override
					public void onClick(View v) {
						// 这是点击详细
					}
				});
			}
		}
		// // 下面来判断内容太长了的时候
		// if (user_trends.get(pos).getContents() != null) {
		// // 内容字数
		// int logs = user_trends.get(pos).getContents().toString().length();
		//
		// if (logs > DongTaiZishu) {
		// String con = user_trends.get(pos).getContents()
		// .substring(0, DongTaiZishu);
		// holder.contents.setText("" + con);
		// // 详细文字按钮
		// holder.xiangxi.setVisibility(View.VISIBLE);
		// holder.xiangxi.setOnClickListener(new View.OnClickListener() {
		// @Override
		// public void onClick(View v) {
		// // 这是点击详细
		// User_trends_Model u = user_trends.get(pos);
		// String path = IOUtils
		// .getSavePinLunObjectPath(getActivity());
		// // 将序列化对象写入sdcard 在AfterLandingDongTaiDiscussFragment中去
		// IOUtils.WriteSerializedObjectsToSDcard(path, (Object) u);
		//
		// ((AfterLandingActivity) (getActivity())).jiazai(12);
		// }
		// });
		// } else if (logs <= DongTaiZishu) {
		// // 内容
		// holder.contents
		// .setText("" + user_trends.get(pos).getContents());
		// holder.xiangxi.setVisibility(View.GONE);
		// }
		// }
		// 发表时间
		holder.addtime.setText(""
				+ CalendarTools.getTimeChangeToString(getActivity(),
						user_trends.get(pos).getAddtime()));
		// 删除和举报按钮
		// 删除和举报
		if (user_trends.get(pos).getDelete_hands() != null) {
			drop(user_trends, pos, holder.drop_down);
		}
		// 获赞次数
		holder.admire.setText("" + user_trends.get(pos).getAdmire());
		// 评论次数
		holder.discuss.setText("" + user_trends.get(pos).getDiscuss());
		// 收藏次数
		holder.collect.setText("" + user_trends.get(pos).getCollect());
		// 分享次数
		holder.share.setText("" + user_trends.get(pos).getShare());

		// 点击赞
		holder.ll_admire.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {

				// 收费的
			}
		});
		// 点击评论
		holder.ll_discuss.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				// User_trends_Model u = user_trends.get(pos);
				// String path = IOUtils.getSavePinLunObjectPath(getActivity());
				// // 将序列化对象写入sdcard 在AfterLandingDongTaiDiscussFragment中去
				// IOUtils.WriteSerializedObjectsToSDcard(path, (Object) u);
				//
				// ((AfterLandingActivity) (getActivity())).jiazai(7);
				Intent intent = new Intent(getActivity(),
						LookAtTheDetailedActivity.class);
				intent.putExtra("User_trends_Model", user_trends.get(pos));
				startActivity(intent);
			}
		});
		if (flags == POST_COLLECT) {
			user_trends.get(pos).setIs_collected(1);
		}
		// 点击收藏
		if (user_trends.get(pos).getIs_collected() == 1) {
			holder.is_collected.setSelected(true);
			holder.is_collected.setOnClickListener(new View.OnClickListener() {

				@Override
				public void onClick(View v) {
					// TODO Auto-generated method stub

				}
			});
		} else {
			holder.is_collected.setSelected(false);
			holder.is_collected.setOnClickListener(new View.OnClickListener() {

				@Override
				public void onClick(View v) {
					// TODO Auto-generated method stub
					pos_ = pos;
					//
					// + user_trends.get(pos).getId() + "/"
					// + user_trends.get(pos).getType());
					collect("0", user_trends.get(pos).getUid(), user_trends
							.get(pos).getId(), user_trends.get(pos).getType());
				}
			});
		}
		// 分享
		holder.ll_share.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				String xinqingtupians = user_trends.get(pos).getTrends_img();
				String[] xinqingtupian = xinqingtupians.split(",");
				String ShareImage = xinqingtupian[0];

				if (!StringUtil.isNullOrEmpty(ShareImage)) {
					ShareSDKTools.ShowOneKeyShare(getActivity(), "分享",
							user_trends.get(pos).getContents(), "",
							Constants.BadiDownImgUrl + "/" + ShareImage,
							"humor_trends", user_trends.get(pos).getId(),
							user_trends.get(pos).getUid(), "0", "humor_trends");
				} else {
					ShareSDKTools.ShowOneKeyShare(getActivity(), "分享",
							user_trends.get(pos).getContents(), "", "",
							"humor_trends", user_trends.get(pos).getId(),
							user_trends.get(pos).getUid(), "0", "humor_trends");
				}
				// ShareSDKTools.ShowOneKeyShare(getActivity(), "分享",
				// user_trends
				// .get(pos).getContents(), "", Constants.BadiDownImgUrl
				// + "/" + ShareImage, "humor_trends", user_trends
				// .get(pos).getId(), user_trends.get(pos).getUid(), "0",
				// "humor_trends");
				ShareSDKTools
						.setOnShareFinishCallBack(new ShareSDKTools.CallBack() {

							@Override
							public void ShareFinishCallBack() {
								// TODO Auto-generated method stub
								int a = Integer.parseInt(user_trends.get(pos)
										.getShare());
								user_trends.get(pos).setShare("" + (a + 1));

								try {
									x1Adapter.notifyDataSetChanged();

								} catch (Exception e) {
									// TODO: handle exception
								}

							}
						});

			}
		});
		// 地址
		holder.xinqingaddress.setVisibility(View.VISIBLE);
		if (user_trends.get(pos).getAddress() != null) {
			holder.xinqingaddress.setText(""
					+ user_trends.get(pos).getAddress());
			holder.xinqingaddress.setVisibility(View.VISIBLE);
		} else {
			holder.xinqingaddress.setVisibility(View.GONE);
		}
	}

	// TODO Auto-generated method stub
	/**
	 * 初始化活动id
	 * 
	 * @param convertView
	 * @param holder
	 */
	public void initActivityId(View convertView, ViewHolder holder) {
		holder.drop_down = (ImageView) convertView.findViewById(R.id.drop_down);
		holder.fenxiang_or_yuanchuang = (TextView) convertView
				.findViewById(R.id.fenxiang_or_yuanchuang);
		/**
		 * 是否已经赞过了
		 */
		holder.is_praise = (ImageView) convertView.findViewById(R.id.is_praise);
		// 头像
		holder.head = (ImageView) convertView.findViewById(R.id.head);
		// 昵称
		holder.nickName = (TextView) convertView.findViewById(R.id.nickName);
		// 昵称
		holder.time = (TextView) convertView.findViewById(R.id.time);
		// 活动名称
		holder.names = (TextView) convertView.findViewById(R.id.names);
		// 活动开始时间和结束时间
		holder.start_timeaddend_time = (TextView) convertView
				.findViewById(R.id.start_timeaddend_time);
		// 删除和举报按钮
		holder.delete_hands = (Button) convertView
				.findViewById(R.id.delete_hands);
		// 地点
		holder.address = (TextView) convertView.findViewById(R.id.address);
		// 活动类型
		holder.typeid = (TextView) convertView.findViewById(R.id.typeid);
		// 获赞次数
		holder.admire = (TextView) convertView.findViewById(R.id.admire);
		// 评论次数
		holder.discuss = (TextView) convertView.findViewById(R.id.discuss);
		// 收藏次数
		holder.collect = (TextView) convertView.findViewById(R.id.collect);
		// 分享次数
		holder.share = (TextView) convertView.findViewById(R.id.share);
		holder.image = (ImageView) convertView.findViewById(R.id.image);
		// 是否收藏
		holder.is_collected = (ImageView) convertView
				.findViewById(R.id.is_collected);
		//
		holder.ll_admire = (LinearLayout) convertView
				.findViewById(R.id.ll_admire);
		holder.ll_discuss = (LinearLayout) convertView
				.findViewById(R.id.ll_discuss);
		holder.ll_collect = (LinearLayout) convertView
				.findViewById(R.id.ll_collect);
		holder.ll_share = (LinearLayout) convertView
				.findViewById(R.id.ll_share);
		holder.ll_link = (LinearLayout) convertView.findViewById(R.id.ll_link);
		holder.publish = (TextView) convertView.findViewById(R.id.fabiaoyu);
		holder.name = (TextView) convertView.findViewById(R.id.club_name);

	};

	/**
	 * 显示 发活动动态
	 * 
	 * @param convertView
	 * @param holder
	 * @param pos
	 */
	public void PostActivityDongtai(final View convertView,
			final ViewHolder holder, final int pos) {

		holder.ll_link.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent(getActivity(),
						ActivityReadingActivity.class);
				intent.putExtra("actId", user_trends.get(pos).getId());

				// 地点
				if (user_trends.get(pos).getIs_online().equals("0")) {
					intent.putExtra("isOnLine", false);
				} else {
					intent.putExtra("isOnLine", true);
					// holder.address.setText("线上主题");//
					// getActivity().getResources().getString(R.string.OnlineTheme)
				}

				startActivity(intent);
			}
		});

		// 判断是不是发表于俱乐部
		if (!user_trends.get(pos).getCid().equals("0")) {
			holder.publish.setVisibility(View.VISIBLE);
			holder.name.setText(user_trends.get(pos).getName());
			holder.name.setOnClickListener(new OnClickListener() {

				@Override
				public void onClick(View v) {
					Intent intent = new Intent(getActivity(),
							ClubHomepageActivity.class);

					intent.putExtra("cid", user_trends.get(pos).getCid());
					startActivity(intent);

				}
			});
		}

		// 分享还是原创的
		if (user_trends.get(pos).getTrends_type().equals("yuanchuang")) {
			holder.fenxiang_or_yuanchuang.setText("");
		} else {
			holder.fenxiang_or_yuanchuang.setText(getResources().getString(
					R.string.wx_txt_58));
		}

		// 是否已经赞过
		if (user_trends.get(pos).getIs_praise().equals("1")) {
			holder.is_praise.setSelected(true);
			holder.is_praise.setOnClickListener(new OnClickListener() {

				@Override
				public void onClick(View v) {

				}
			});

		} else // 0未赞
		{
			holder.is_praise.setSelected(false);
			holder.is_praise.setOnClickListener(new OnClickListener() {

				@Override
				public void onClick(View v) {

					change_imageView = holder.is_praise;
					change_text = holder.admire;
					dianzan(getActivity(), Utils.getUid(getActivity()),
							user_trends.get(pos).getId(), user_trends.get(pos)
									.getUid(), user_trends.get(pos).getType(),
							pos);

				}
			});
		}
		// 头像
		try {
			ImageLoader.getInstance().displayImage(
					Constants.BadiDownImgUrl + "/"
							+ user_trends.get(pos).getHead()
							+ Constants.appPhoto4img, holder.head, options);
		} catch (Exception e) {

		}
		holder.head.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				if (user_trends.get(pos).getUid()
						.equals(Utils.getUid(getActivity()))) {
					// ((AfterLandingActivity) (getActivity())).jiazai(9);
					Intent intent = new Intent(getActivity(),
							MyDataActivity.class);
					// intent.putExtra("isStartTwoClose", true);
					startActivity(intent);

				} else {
					// Utils.setOtherid(getActivity(), ""
					// + user_trends.get(pos).getUid());
					// ((AfterLandingActivity) (getActivity())).jiazai(11);

					Intent intent = new Intent(getActivity(),
							SeeOtherPeopleSpaceActivity.class);
					intent.putExtra("friend_id", user_trends.get(pos).getUid());

					startActivity(intent);
				}
			}
		});
		// 昵称
		holder.nickName.setText("" + user_trends.get(pos).getNickName());
		holder.nickName.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {

				if (!StringUtil.isNullOrEmpty(user_trends.get(pos).getUid())) {
					if (user_trends.get(pos).getUid()
							.equals("" + Utils.getUid(getActivity()))) {
						// ((AfterLandingActivity) (getActivity())).jiazai(9);
						Intent intent = new Intent(getActivity(),
								MyDataActivity.class);
						// intent.putExtra("isStartTwoClose", true);
						startActivity(intent);

					} else {
						Intent intent = new Intent(getActivity(),
								SeeOtherPeopleSpaceActivity.class);
						intent.putExtra("friend_id", user_trends.get(pos)
								.getUid());

						startActivity(intent);
					}
				}

			}
		});
		// 时间
		holder.time.setText(""
				+ CalendarTools.getTimeChangeToString(getActivity(),
						user_trends.get(pos).getTime()));

		// 活动名称
		holder.names.setText("" + user_trends.get(pos).getNames());
		// 活动开始时间和结束时间
		holder.start_timeaddend_time.setText(""
				+ Utils.Back_Data(user_trends.get(pos).getStart_time()) + "-"
				+ Utils.Back_Data(user_trends.get(pos).getEnd_time()));
		// 删除和举报按钮
		// 删除和举报
		if (user_trends.get(pos).getDelete_hands() != null) {
			drop(user_trends, pos, holder.drop_down);
		}

		//
		if (user_trends.get(pos).getIs_online() != null) {
			// 地点
			if (user_trends.get(pos).getIs_online().equals("0")) {
				holder.address.setText("" + user_trends.get(pos).getAddress());
			} else {
				holder.address.setText(getResources().getString(
						R.string.wx_up_zhuti));// getActivity().getResources().getString(R.string.OnlineTheme)
			}
		}
		// 活动类型
		holder.typeid.setText("" + user_trends.get(pos).getType_name());
		// 获赞次数
		holder.admire.setText("" + user_trends.get(pos).getAdmire());
		// 评论次数
		holder.discuss.setText("" + user_trends.get(pos).getDiscuss());
		// 收藏次数
		holder.collect.setText("" + user_trends.get(pos).getCollect());
		// 分享次数
		holder.share.setText("" + user_trends.get(pos).getShare());
		try {
			ImageLoader.getInstance().displayImage(
					Constants.BadiDownImgUrl + "/"
							+ user_trends.get(pos).getImage()
							+ Constants.App9block, holder.image, options);
		} catch (Exception e) {

		}
		// 点击赞
		holder.ll_admire.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {

				// 收费的
			}
		});
		// 点击评论
		holder.ll_discuss.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				// User_trends_Model u = user_trends.get(pos);
				// String path = IOUtils.getSavePinLunObjectPath(getActivity());
				// // 将序列化对象写入sdcard 在AfterLandingDongTaiDiscussFragment中去
				// IOUtils.WriteSerializedObjectsToSDcard(path, (Object) u);
				//
				// ((AfterLandingActivity) (getActivity())).jiazai(7);
				Intent intent = new Intent(getActivity(),
						LookAtTheDetailedActivity.class);
				intent.putExtra("User_trends_Model", user_trends.get(pos));
				startActivity(intent);
			}
		});
		// 点击收藏
		holder.ll_collect.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {

			}
		});
		// 分享
		holder.ll_share.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {

				if (!StringUtil.isNullOrEmpty(user_trends.get(pos).getImage())) {
					ShareSDKTools.ShowOneKeyShare(
							getActivity(),
							"分享",
							user_trends.get(pos).getNames(),
							"",
							Constants.BadiDownImgUrl + "/"
									+ user_trends.get(pos).getImage(),
							"activity", user_trends.get(pos).getId(),
							user_trends.get(pos).getUid(), "0", "activity");
				} else {
					ShareSDKTools.ShowOneKeyShare(getActivity(), "分享",
							user_trends.get(pos).getNames(), "", "",
							"activity", user_trends.get(pos).getId(),
							user_trends.get(pos).getUid(), "0", "activity");
				}
				// ShareSDKTools.ShowOneKeyShare(getActivity(), "分享",
				// user_trends
				// .get(pos).getNames(), "", Constants.BadiDownImgUrl
				// + "/" + user_trends.get(pos).getImage(), "activity",
				// user_trends.get(pos).getId(), user_trends.get(pos)
				// .getUid(), "0", "activity");
				ShareSDKTools
						.setOnShareFinishCallBack(new ShareSDKTools.CallBack() {

							@Override
							public void ShareFinishCallBack() {
								// TODO Auto-generated method stub
								int a = Integer.parseInt(user_trends.get(pos)
										.getShare());
								user_trends.get(pos).setShare("" + (a + 1));

								try {
									x1Adapter.notifyDataSetChanged();

								} catch (Exception e) {
									// TODO: handle exception
								}

							}
						});
			}
		});
		//

	}

	// ///////
	static class ViewHolder {
		public TextView pictureNum;
		public ImageView drop_down;
		public TextView xinqingaddress;
		public LinearLayout ll_link;
		public TextView fenxiang_or_yuanchuang;
		public ImageView is_collected;
		// 顶部视图
		// one
		public LinearLayout ll_home_page;// 个人主页
		public LinearLayout ll_picture;// 照片
		public LinearLayout ll_record;// 记录
		public LinearLayout ll_club;// 俱乐部
		public LinearLayout ll_activity;// 活动
		// two
		public LinearLayout ll_collect;// 收藏
		public LinearLayout ll_friends;// 朋友
		public LinearLayout ll_data;// 资料
		public LinearLayout ll_otherspace;// 其他空间

		public ImageView left;
		public ImageView right;
		public LinearLayout two_line;
		public LinearLayout two;
		public LinearLayout one_line;
		public LinearLayout one;
		public TextView t_friends;
		public TextView t_activity;
		public TextView t_club;
		public TextView t_record;
		public TextView t_picture;
		public TextView tv_city;
		public TextView tv_nickName;
		public TextView tv_motto;
		public ImageView iv_touxiang;
		public ImageView iv_beijing;
		// 'record' 对应的属性
		// public String type;//类型 用于判断接收返回值是选用的model
		public TextView view;// 浏览次数
		// public String discuss;//评论次数
		// public String collect;//收藏次数
		// public String id;//该记录的id
		// public String time;//记录添加时间
		public ImageView image;// 封面图
		public TextView content;// 记录的内容
		// public String delete_hands;//自己 为删除 别的人 举报
		// public String nickName;//发表信息用户昵称
		// private String head//发表信息用户头像
		// private String uid//发表信息的用户id

		// 'photo' 对应的属性（相册）

		// public String type;//类型 用于判断接收返回值是选用的model
		public TextView time;// 上传时间
		public TextView comment;// 评论
		public TextView reprint;// 获赞
		public TextView img;// 上传的照片路劲和id
		public TextView z_user;// 点赞的人名称和id
		public TextView img_count;// 上传照片的数量
		public TextView photo_name;// 上传到到哪个相册名称
		// public String delete_hands;//自己 为删除 别的人 举报
		// public String nickName;//发表信息用户昵称
		// private String head//发表信息用户头像
		// private String uid//发表信息的用户id
		// public ImageView iv_0;
		// public ImageView iv_1;
		// public ImageView iv_2;
		// public ImageView iv_3;
		// public ImageView iv_4;
		// public ImageView iv_5;
		// public ImageView iv_6;
		// public ImageView iv_7;
		// public ImageView iv_8;
		public LinearLayout l_width;
		public ImageView is_praise;// 是否已赞

		// public GridView gv_xinqingpicture;

		// 'humor_trends'心情动态类型
		private String id;// 动态id
		// public String admire;//获赞次数
		// public String discuss;//评论次数
		public TextView collect;// 收藏次数
		public TextView share;// 分享次数
		public String trends_img;// 心情图片路径，多张图片路径用逗号分隔开
		public TextView contents;// 内容
		public String img_url;// 图片网址
		public String video_url;// 视频网址
		public String word_url;// 文字网址
		public TextView addtime;// 发表时间
		// public String delete_hands;//自己 为删除 别的人 举报
		// public String nickName;//发表信息用户昵称
		// public String head;//发表信息用户头像
		// public String uid;//发表信息的用户id
		// public String is_praise;//是否已赞
		public GridView gv_xinqingpicture;// 显示要上传的图片

		// 'activity' 对应的属性（活动）
		public String type;// 类型 用于判断接收返回值是选用的model
		// public String uid;//用户Id
		public TextView start_time;// 开始时间//
		public TextView end_time;// 结束时间

		public TextView start_timeaddend_time;
		public TextView names;// 活动名字
		public TextView typeid;// 活动类型
		public String introduce;// 活动内容简介
		public String gold;// 参加活动所需金额
		public String applied;// 已报名数
		public TextView discuss;// 评论
		public TextView admire;// 赞
		// public String nickName;//用户昵称
		// public String head;//用户头像
		// public String uid;//发表信息的用户id
		// public String delete_hands;//自己 为删除 别的人 举
		public String is_online;// 线上或线下（0：线下，1：线上）
		public TextView address;// 只有活动为线下时 才有此值
		// public String time;//写这条动态的时间
		// private String collect;//收藏次数
		// private String share;//分享次数
		// private String image;//活动代表图
		// 分别是四个 赞，评论，分享，收藏
		public LinearLayout ll_admire, ll_discuss, ll_share;// ll_collect,
		// public String is_praise;//是否已赞
		// 'club' 对应的属性 （俱乐部）

		private TextView nickName;// 用户昵称
		private ImageView head;// 用户头像
		private String uid;// 发表信息的用户id
		private String cid;// 俱乐部id
		private TextView name;// 俱乐部名称
		private ImageView logo;// 俱乐部logo
		private TextView originate_address;// 俱乐部地址
		private TextView price;// 俱乐部加入所需金币
		private Button delete_hands;// 自己 为删除 别的人 举报
		// private String time;
		// private String discuss; //评论
		// private String admire; //赞
		// private String collect; //收藏
		// private String share; //分享
		public TextView typeName;// 俱乐部类型
		public TextView xiangxi;
		private TextView publish;
		private ImageView videoimage;
		private TextView videotitle;
		public LinearLayout videoxianshi;
		// public String is_praise;//是否已赞

		// public LinearLayout ll_admire,ll_dicuss,ll_share;//ll_collect,
	}

	private void addData(int page2, Object object) {
		// TODO Auto-generated method stub
		MyThreadTool.fixedThreadPool.execute(new Runnable() {
			@Override
			public void run() {
				list = new ArrayList<User_trends_Model>();
				personalCenterHomePageModel = new PersonalCenterHomePageModel();
				Map<String, Object> map = new HashMap<String, Object>();
				if (flags == POST_PERSONAL_CENTE_HOME_PAGE)
					map.put("languageType",
							Dialog.getSystemLanguageTypegrzx(getActivity()));
				if (flags == POST_COLLECT) {
					if (!fid.equals("-1"))
						map.put("fid", fid);
				}
				map.put("uid", uid);
				map.put("page", page);
				map.put("pageNum", pageNum);
				//
				// (map.toString());
				String content = null;
				if (flags == POST_PERSONAL_CENTE_HOME_PAGE) {
					content = Utils.sendRequest(map, Constants.BadiUrl
							+ "personal_cente_home_page");
					System.out.println("zhuye" + content);

				}

				else if (flags == POST_COLLECT)
					content = Utils.sendRequest(map, Constants.BadiUrl
							+ "collect");

				if (content != null) {
					Results results = Utils.checkResult_NNN(getActivity(),
							content);
					if (results != null && !results.getRetmsg().equals("null")) {
						try {

							if (flags == POST_PERSONAL_CENTE_HOME_PAGE) {
								personalCenterHomePageModel = JSONUtils.getEntityByJsonString(
										results.getRetmsg(),
										PersonalCenterHomePageModel.class);
								System.out.println("content"
										+ results.getRetmsg());

							} else if (flags == POST_COLLECT) {
								list = JSONUtils.getListByJsonString(
										results.getRetmsg(),
										User_trends_Model.class);
								System.out.println("aa" + results.getRetmsg());
							}

							if (personalCenterHomePageModel2 == null) {
								personalCenterHomePageModel2 = personalCenterHomePageModel;
							}

							handler.sendEmptyMessage(2);
						} catch (Exception e) {

						}
					} else {
						if (page > 1) {
							--page;
						} else {
							page = 1;
						}
						handler.sendEmptyMessage(3);
					}
				} else {
					if (page > 1) {
						--page;
					} else {
						page = 1;
					}
					handler.sendEmptyMessage(1);
				}
			}
		});
	}

	@Override
	public void onRefresh() {
		// addData(page, null);
		page = 1;
		user_trends = new ArrayList<User_trends_Model>();
		addData(page, null);

	}

	@Override
	public void onLoadMore() {
		//
		page = page + 1;
		addData(page, null);
	}

	/**
	 * 删除动态 动态的id
	 */
	public void deleteDongTai(String id) {
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", Utils.getUid(getActivity()));
		map.put("trendsId", id);
		CommonUtils.CommomPostfunction(getActivity(), Constants.BadiUrl_1
				+ "commonality/deleteTrends", map, handler, 1, 9, 7, 8);
	}

	/**
	 * 举报 被举报人的id 举报类行
	 * 
	 * @param bei_person_id
	 *            被举报人id
	 * @param table
	 *            举报类型humor_trends：心情动态，photo：相册，record：记录（篇），record_article：记录（
	 *            记），activity：活动，club：俱乐部，discuss：评论
	 * @param bei_neirong_id
	 *            举报的内容id
	 */
	public void jubao(String bei_person_id, String table, String bei_neirong_id) {
		Intent intent = new Intent(getActivity(), InformActivity.class);
		intent.putExtra("bei_person_id", bei_person_id);
		intent.putExtra("table", table);
		intent.putExtra("bei_neirong_id", bei_neirong_id);
		intent.putExtra("bei_cid", "0");
		startActivity(intent);
	}

	/**
	 * 点赞 接口名称 praise_operate 用户的点赞人的id 提交方式$GET
	 * 
	 * @param $uid
	 *            ;//点赞人的id
	 * @param $nid
	 *            ;//被操作内容的Id
	 * @param $nuid
	 *            ;//内容所属人id
	 * @param $type赞的类型
	 *            （record_article，club，humor_trends，photo，activity）
	 * @param hander
	 *            ;
	 * @param Success
	 *            ;成功
	 * @param defalt
	 *            ;失败
	 */
	public void dianzan(final Context context, final String uid,
			final String nid, final String nuid, final String type,
			final int pos) {
		Utils.showPrgress(context);
		MyThreadTool.fixedThreadPool.execute(new Runnable() {

			@Override
			public void run() {

				String content = Utils.getRequest(Constants.BadiUrl
						+ "praise_operate?uid=" + uid + "&nid=" + nid
						+ "&nuid=" + nuid + "&type=" + type);
				//
				// + "type=" + type);
				// ("数据是：" + content);
				if (content != null) {
					// ("数据是：" + content);
					results = Utils.checkResult_NNN(context, content);
					if (results != null && !results.getRetmsg().equals("null")) {
						//
						try {
							int c = pos;
							Message msg = new Message();
							msg.what = 5;
							Bundle bun = new Bundle();
							bun.putInt("pos", c);
							msg.setData(bun);

							handler.sendMessage(msg);
						} catch (Exception e) {

						}
					} else {
						handler.sendEmptyMessage(1);
					}
				} else {
					handler.sendEmptyMessage(1);
				}
			}
		});

	}

	/**
	 * 收藏的内容
	 * 
	 * @param nuid
	 *            被收藏内容所属的用户id
	 * @param neirong_id
	 *            /被收藏的内容id
	 * @param type
	 *            被收藏的类型 （photo_img，record，humor_trends）
	 */
	public void collect(String cid, String nuid, String neirong_id, String type) {// Constants.BadiUrl+
																					// "praise_operate?uid="+uid+"&nid="+nid+"&nuid="+nuid+"&type="+type
		/*
		 * 用户收藏的操作接口 提交方式GET
		 * 
		 * @param $uid;//收藏人的id @param $nuid;//被收藏内容所属的用户id
		 * 
		 * @param $nid;//被收藏的内容id @param
		 * $type;//被收藏的类型（photo_img，record，humor_trends）
		 */
		String uid = Utils.getUid(getActivity());

		CommonUtils.CommomGetfunction(getActivity(), Constants.BadiUrl
				+ "collect_operate?uid=" + uid + "&cid=" + cid + "&nuid="
				+ nuid + "&nid=" + neirong_id + "&type=" + type, handler, 1, 9,
				10, 11);
	}

	public void drop(final List<User_trends_Model> user_trends, final int pos,
			ImageView drop) {

		LayoutInflater inflater = LayoutInflater.from(getActivity());
		View root = inflater.inflate(R.layout.drop_down, null);

		TextView delete_hands = (TextView) root.findViewById(R.id.delete_hands);
		if (user_trends.get(pos).getDelete_hands() != null) {
			if (user_trends.get(pos).getDelete_hands().equals("删除")) {
				// LogUtils.d("Delete_hands="+user_trends.get(pos).getDelete_hands());
				user_trends.get(pos).setDelete_hands(
						getActivity().getString(R.string.Delete));
			} else if (user_trends.get(pos).getDelete_hands().equals("举报")) {
				// LogUtils.d("Delete_hands="+user_trends.get(pos).getDelete_hands());
				user_trends.get(pos).setDelete_hands(
						getActivity().getString(R.string.Inform));
			}
		}

		delete_hands.setText("" + user_trends.get(pos).getDelete_hands());
		if (user_trends.get(pos).getDelete_hands()
				.equals(getResources().getString(R.string.wx_delete))) {
			delete_hands.setOnClickListener(new OnClickListener() {

				@Override
				public void onClick(View v) {
					// TODO Auto-generated method stub
					Dialog dialog = new Dialog();
					dialog.CreateDialog(getActivity(), getResources()
							.getString(R.string.wx_txt_55), getResources()
							.getString(R.string.wx_txt_56));
					dialog.setOnDialogClistener(new Dialog.DialogClistener() {

						@Override
						public void ret() {
							// TODO Auto-generated method stub

						}

						@Override
						public void ok() {
							// TODO Auto-generated method stub
							delete_where_dongtai = pos;
							deleteDongTai(user_trends.get(pos).getTrendsId());
						}
					});
				}
			});
		} else {
			delete_hands.setOnClickListener(new View.OnClickListener() {

				@Override
				public void onClick(View v) {
					// TODO Auto-generated method stub
					jubao(user_trends.get(pos).getUid(), user_trends.get(pos)
							.getType(), user_trends.get(pos).getId());
					// 就是举报
				}
			});
		}
		PopWindowUtils.showPopWindow(getActivity(), root, drop);

		// // 删除和举报按钮
		// holder.delete_hands
		// .setText("" + user_trends.get(pos).getDelete_hands());
		// if (user_trends.get(pos).getDelete_hands().equals("删除")) {
		// holder.delete_hands.setOnClickListener(new View.OnClickListener() {
		//
		// @Override
		// public void onClick(View v) {
		// // TODO Auto-generated method stub
		//
		// Dialog dialog = new Dialog();
		// dialog.CreateDialog(getActivity(), "删除动态？", "是否删除该动态？");
		// dialog.setOnDialogClistener(new Dialog.DialogClistener() {
		//
		// @Override
		// public void ret() {
		// // TODO Auto-generated method stub
		//
		// }
		//
		// @Override
		// public void ok() {
		// // TODO Auto-generated method stub
		// delete_where_dongtai = pos;
		// deleteDongTai(user_trends.get(pos).getTrendsId());
		// }
		// });
		// }
		// });
		//
		// } else {
		// holder.delete_hands.setOnClickListener(new View.OnClickListener() {
		//
		// @Override
		// public void onClick(View v) {
		// // TODO Auto-generated method stub
		// jubao(user_trends.get(pos).getUid(), user_trends.get(pos)
		// .getType(), user_trends.get(pos).getId());
		// // 就是举报
		// }
		// });
		// }
	}

}
